package org.itheimma.springbootquickstart.mapepr;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.itheimma.springbootquickstart.pojo.Images;

@Mapper
public interface ImgMapper {
//    @Select("select * from images where image_id=#{image_id}")
//    public Images findByImgId(int imageId);

    @Insert("insert into images(Three_id,image_url,uploaded_by,upload_timestamp)" +
            " values(#{threeId},#{imageUrl},#{uploadedBy},now())")
    @Options(useGeneratedKeys = true)
    public void add(int threeId, String imageUrl, String uploadedBy);
}
